package com.wss.day10.stream;

import java.util.ArrayList;
import java.util.Collections;
import java.util.stream.Stream;

/**
 * @author wangshaoshuai
 * @desc TODO
 * @date 2025/5/6
 */
public class Test1 {
    public static void main(String[] args) {
        ArrayList<String> list1 = new ArrayList<>();
        Collections.addAll(list1, "王一一","张呃呃","张三", "张四四");

        ArrayList<String> list2 = new ArrayList<>();
        Collections.addAll(list2, "张一", "王二","张三", "王思","张武");

        Stream<String> team1= list1.stream().
                filter(name -> name.length() == 3)
                .limit(3);


        Stream<String> team2= list2.stream().
                filter(name -> name.startsWith("张"))
                .skip(2);

        Stream.concat(team1,team2).forEach(s -> System.out.println(s));
    }
}
